import api from './config'

export const permissionApi = {
  // 获取所有权限列表
  getPermissions: () => {
    return api.get('/permissions')
  },

  // 创建新权限
  createPermission: (permissionData) => {
    return api.post('/permissions/create', permissionData)
  },

  // 删除权限
  deletePermission: (permissionId) => {
    return api.delete(`/permissions/${permissionId}`)
  },

  // 获取权限规则配置
  getPermissionRules: () => {
    return api.get('/permissions/rules')
  },

  // 更新权限规则配置
  updatePermissionRules: (rules) => {
    return api.put('/permissions/rules', rules)
  },

  // 刷新权限规则配置
  refreshPermissionRules: () => {
    return api.post('/permissions/rules/refresh')
  }
} 